import { Command } from 'commander'
import { version } from '../package.json'
import { createProject } from './command/create'
import { update } from './command/update'

const program = new Command('rysx')

program.version(version, '-v, --version', 'output the current version')

program
  .command('create')
  .description('create new project')
  .argument('[name]', 'create project name')
  .action((dirname) => {
    createProject(dirname)
  })

program
  .command('update latest')
  .description('update rysx-cli latest version')
  .action(() => {
    update()
  })

program.parse()